<?php

	class Setting extends Setting_model {

		function __construct() {
			parent::__construct();
		}
                
                function getInstance($code) {
                    $setting = new Setting();
                    $setting->addWhere("code = '$code'");
                    $setting->find();
                    
                    if ($setting->countRows() > 0) {
                        $setting->fetchFirst();
                        return $setting;
                    }
                    else {
                        return false;
                    }
                }
                
                function loadParamsByCat($category) {
                    $setting = new Setting();
                    $setting->addWhere("category = '$category'");
                    $setting->find();
                    
                    if ($setting->countRows() > 0) {
                        $setting->fetchFirst();
                        return $setting;
                    }
                    else {
                        return false;
                    }
                }
	}
